package com.masterviame.Authc.service;

import com.masterviame.Authc.pojo.User;

import java.util.List;
import java.util.Set;

/**
 * Created by mastervictory on 2017/12/13.
 */
public interface UserService {
    /**
     * 创建用户
     * @param user
     * @return
     */
    public void createUser(User user);
    /**
     * 修改密码
     * @param userid
     * @param Password
     */
    public void changePassword(long userid,String  Password);
    /**
     * 添加用户-角色关系
     * @param userid
     * @param roleids
     */
    public void correlationRoles(long userid,long... roleids);

    /**
     * 根据用户名查找用户
     * @param username
     * @return
     */
    public User findByUsername(String username);

    public Set<String> findRoles(String username);

    /**
     * 根据用户名查找其权限
     * @param username
     * @return
     */
    public Set<String> findPermissions(String username);

    public List<User> getallUsers();

    public void updateUser(User user);

    public void deleteUser(long userid);

    public User getUser(long userid);

    public void deleteUserRole(long userid,long... roleid);

    public void deleteUserRoles(long userid);

    public void lock(long userid);
}
